<?php 
global $language, $base_url, $base_path;
$action_prefix = "/".$language->language . $base_path;
$user = $items['user'];
$profile = $items['profile'];
$exp_list = $items['exp_list'];
$user_pic_uri = 'public://user_pictures/avatar_default.png';
if(!empty($user->picture)) {
  $file = file_load($user->picture->fid);
  $user_pic_uri = $file->uri;
}
$user_pic = file_create_url($user_pic_uri);
$cnid = $user->field_cnode[LANGUAGE_NONE][0]['target_id'];

?>
<div class="row-fluid">
<div class="span3">
  <img class="profile-avatar" src="<?php print $user_pic; ?>"/>
  <a class="btn btn-large btn-info btn-block new_message_modal" data-target="#new_message_modal" data-toggle="modal" href="javascript:void(0);" rel="<?php echo $user->name;?>">
  <?php print t("Contact Me");?></a>

  <?php if(!$items['edit']): ?>
  <a class="btn btn-large btn-block" href="<?php print $action_prefix.'profile/'.$user->uid.'/reviews/new'; ?>">
  <?php print t("Review Me");?>
  </a>
  <?php endif;?>
</div>

<div class="span9">
  <h1 class="profile-name"><?php print $profile->field_name[LANGUAGE_NONE][0]['value'];?></h1>
  <?php if($items['edit']): ?>
  <div class="profile-edit-btn">
    <div class="pull-right">
        <a class="btn" href="<?php print $action_prefix; ?>profile/edit" id="edit-button">
            <i class="icon-pencil">
            </i>
            <?php print t("Edit");?>
        </a>
    </div>
  </div>
  <?php endif;?>
  <p class="profile-biography"><?php print $profile->field_biography[LANGUAGE_NONE][0]['value']; ?></p>
  <p><?php print t("Location:") . $profile->field_address[LANGUAGE_NONE][0]['value']; ?></p>
  <p><?php print t("Languages:") . $profile->field_language[LANGUAGE_NONE][0]['value']; ?></p>
</div>

</div>

<div class="row my-exp-list">
<h1><?php print t("FEATURED EXPERIENCES"); ?></h1>
  <?php foreach ($exp_list as $key => $item): ?>
    <?php $img_url = image_style_url('large', $item->uri); ?>
    <div class="card3 card3-medium span4">

      <div class="card3-photo">
        <a href="<?php print $action_prefix . "experience/" . $item->nid; ?>">
        <div class="img" style="background: #242731 url('<?php print $img_url;?>') no-repeat center center;"></div>
        </a>
      </div>

      <div class="card3-details">
        <div class="card3-name"><a class="text-color" href="<?php print $action_prefix . "experience/" . $item->nid; ?>"><?php print $item->title; ?></a></div>  
        <div class="card3-user"><?php print t("with"); ?> <a href="<?php print $action_prefix . "profile/". $item->uid; ?>"><?php print $item->exp_name; ?></a></div> 
        <p class="card3-description"><a href="<?php print $action_prefix . "experience/" . $item->nid; ?>">
          <?php print strip_tags($item->detail); ?>
        </a></p>
      </div>

    </div>
  <?php endforeach; ?>
</div>

<div class="row my-profile-list">
<h1><?php print t("REVIEWS FOR ").$user->name; ?></h1>
<?php print $items['comments']; ?>
<div class="pull-right">
  <?php if(!empty($items['comments'])):?>
  <a href="<?php print $action_prefix."profile/".$user->uid."/reviews"; ?>"><?php print t("All reviews by ").$user->name;?></a>
  <?php endif;?>
</div>
</div>
